import { Limit } from '@common/utils/constants';
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString, ValidateNested } from 'class-validator';
import { ObjectId } from 'mongoose';
import { AuditStatus } from '../schemas/photos.schema';
class ListPhotoWhereDto {
    @ApiProperty()
    @IsOptional()
    @IsString()
    user?: ObjectId & string;
    @ApiProperty()
    @IsOptional()
    @IsString()
    photosType?: ObjectId & string;
    @ApiProperty()
    @IsOptional()
    @IsString()
    keyword?: string;
    @ApiProperty()
    @IsEnum(AuditStatus)
    @IsOptional()
    auditStatus?: AuditStatus;
}

export class ListPhotoDto {
    @ApiProperty()
    @ValidateNested()
    @IsNotEmpty()
    // 这里不加Type不会验证
    @Type(() => ListPhotoWhereDto)
    where: ListPhotoWhereDto;
    @IsOptional()
    @ValidateNested()
    @Type(() => Limit)
    limit?: Limit;
}
